<template>
	<view>
		<image  v-for="(item,index) in imgList" v-bind:src="item" v-bind:key="index" v-on:click="previewImg(item)"></image>
		<button type="primary" v-on:click="chooseImg">上传图片</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				imgList:[]
			}
		},
		methods: {
			chooseImg(){
				uni.chooseImage({
					count:5,
					success: (res)=> {
						this.imgList = res.tempFilePaths
					}
				})
			},
			previewImg(current){
				uni.previewImage({
					current,
					urls:this.imgList,
					loop:true,
					indicator:'number'
				})
			}
		}
	}
</script>

<style>

</style>
